for i = 1:dim(2)
     aux1 = ( -2*log(rand(1,1) )) ^ (1/2);
     aux2 = sin(2*pi*rand(1,1));
     gauss(1,i) = aux1*aux2;
end

%desvio
sr = ebno/10;
sr = 10^sr;
desvio = (sqrt(1/(2*(dim(1)/dim(2))*1*sr)));

%recebx = transx(1,:) + randn(1,n)*sigma;
codbpsk = codbpsk + gauss(1,:).*desvio;

%normalizar
codbpsk = codbpsk./max(abs(codbpsk));
